package com.xbongbong.paas.pojo.dto;

import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.QueryIgnore;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author: wufeng
 * @date: 2018/8/21 9:32
 * @desrcption: 节点更新对象
 */
@Getter
@Setter
@ToString
public class ProcessUpdateDTO extends BaseDTO {
    private static final long serialVersionUID = -6968847893973463730L;
    /**
     * 应用id
     */
    @NotNull(message = "{dto.msg.processUpdate.appId.NotNull}")
    private Long appId;

    @NotNull(message = "{dto.msg.processUpdate.menuId.NotNull}")
    private Long menuId;

    /**
     * 表单id
     */
    @NotNull(message = "{dto.msg.processUpdate.formId.NotNull}")
    private Long formId;

    /**
     * 流程图类型
     */
    @NotNull(message = "{dto.msg.processUpdate.type.NotNull}")
    private Integer type;

    /**
     * 流程属性
     */
    @NotNull(message = "{dto.msg.processUpdate.processTemplate.NotNull}")
    @Valid
    @Getter(onMethod_ = {@QueryIgnore})
    private ProcessTemplateUpdateDTO processTemplate;

    /**
     * 流程节点
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<ProcessTemplateNodeUpdateDTO> nodeList;

    /**
     * 流转条件
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<ProcessConditionUpdateDTO> conditionList;

    /**
     * saas还是paas标记
     */
    @NotNull(message = "{dto.msg.processUpdate.saasMark.NotNull}")
    @DecimalMin(value = "1", message = "{dto.msg.processUpdate.saasMark.DecimalMin}")
    @DecimalMax(value = "2", message = "{dto.msg.processUpdate.saasMark.DecimalMax}")
    private Integer saasMark;

    /**
     * SaaS审批类型
     */
    private Integer businessType;

    private Integer del;
    @Getter(onMethod_ = {@QueryIgnore})
    private List<NewProcessNodeDTO> newProcessNodeList;

    public ProcessUpdateDTO(){
        del = 0;
    }

}
